#ifndef FSUTILITY_H_
#define FSUTILITY_H_

#include "status.hxx"
#include <vector>


class FsUtility {

public:
	
	// Returns true if the named file exists.
	static bool fileExists(const std::string& fname);

	//Returns true if it is a directory
	static bool isDir(const std::string& fname);
		
	// get children
	static DbStatus getChildren(const std::string& dir,
							 std::vector<std::string>& result);

	// Delete the named file.
	static DbStatus deleteFile(const std::string& fname);

	// Create the specified directory.
	static DbStatus createDir(const std::string& dirname);

	// Delete the specified directory.
	static DbStatus deleteDir(const std::string& dirname);

	// Store the size of fname in *file_size.
	static DbStatus getFileSize(const std::string& fname, uint64_t& file_size);

	// Rename file src to target.
	static DbStatus renameFile(const std::string& src,
							const std::string& target);

    static DbStatus truncateFile(const std::string& fname, uint64_t offset);
};

#endif
